<div id="information">
<br /><br />
<?php
	$select_q='SELECT * FROM questions WHERE testid='.$_GET['id'].' ORDER BY id ASC LIMIT 10';
	$r_q=mysql_query($select_q);
	if(mysql_num_rows($r_q)==0){
	   echo "<p class='error'>Няма въпроси към теста!</p>";
	} else {
	$i=1;
	$true=0;
	$false=0;
	?>
	<form method="post" action="">
	<?php
	while($row_q=mysql_fetch_assoc($r_q)){
	   $array[0]=$row_q['a'];
	   $array[1]=$row_q['b'];
	   $array[2]=$row_q['c'];
	   $array[3]=$row_q['d'];
	   shuffle($array);
	   $real_otg=$row_q['otg'];
	   if($_POST['hide7']!=48){
	   ?>
	   <div style="margin-left: 25px;">
	   <?php
	   echo "<p style='font-size: 14px; background-color: #fff; box-shadow: 3px 3px 3px gray; margin-right: 25px; font-weight: bold;'>".$i.'. '.$row_q['vapros']."</p>";
	   
	   echo '<p style="margin-left: 20px;">а)<input type="radio" name="'.$row_q['id'].'" value="'.$array[0].'"/>'.$array[0]."</p>";
	   echo '<p style="margin-left: 20px;">б)<input type="radio" name="'.$row_q['id'].'" value="'.$array[1].'"/>'.$array[1]."</p>";
	   echo '<p style="margin-left: 20px;">в)<input type="radio" name="'.$row_q['id'].'" value="'.$array[2].'"/>'.$array[2]."</p>";
	   echo '<p style="margin-left: 20px;">г)<input type="radio" name="'.$row_q['id'].'" value="'.$array[3].'"/>'.$array[3]."</p>";
	   ?>
	   </div>
	   <?php
       }
	   else{
	      echo "<p style='margin-left: 25px;font-size: 14px; background-color: #fff; box-shadow: 3px 3px 3px gray; margin-right: 25px; font-weight: bold;'>".$i.'. '.$row_q['vapros']."</p>";
	      if($_POST[$row_q['id']]==$real_otg){
		      echo '<p style="margin-left: 25px;">Вие отговорихте: '.$_POST[$row_q['id']];
			  echo "<img src='../img/true.png' style='width: 30px; height: 25px; float: right; margin-right: 25px;' alt='true'/></p>";
			  $true++;
		  }
		  elseif($_POST[$row_q['id']]!=$real_otg){
		  if(empty($_POST[$row_q['id']])){
		  echo '<p style="margin-left: 25px;">Вие не отговорихте на въпроса<br />';
		  echo 'Верният отговор е: <b>'.$real_otg."</b><img src='../img/false.png' style='width: 30px; height: 25px; float: right; margin-right: 25px;' alt='false'/></p>";
		  $false++;
		  }
		  else{
		  echo '<p style="margin-left: 25px;">Вие отговорихте: '.$_POST[$row_q['id']]."<br />";
		  echo 'Верният отговор е: <b>'.$real_otg."</b><img src='../img/false.png' style='width: 30px; height: 25px; float: right; margin-right: 25px;' alt='false'/></p>";
		  $false++;
		  }
		  }
	   }
	   $i++;
	}
	if($_POST['hide7']==48){
	echo "<p><br /></p>";
	echo '<hr style="width:90%"/>';
	echo '<p style="margin-left: 25px;"><b>Верни отговори: </b>'.$true.'</p>';
	echo '<p style="margin-left: 25px;"><b>Грешни отговори: </b>'.$false.'</p>';
	echo '<hr style="width:90%"/>';
	$all = $true + $false; 
    $koef = $true/$all; 
    $koef = $koef*100; 
    $koef = round($koef); 
	echo '<p style="margin-left: 25px;"><b>Успеваемост: </b>'.$koef.'%</p>';
	}
	if($_POST['hide7']!=48){
	?>
	<p><input type="submit" name="submit" value="Провери" class="subb"/></p>
	<p><input type="hidden" name="hide7" value="48"/></p>
	<?php 
	} 
	} 
	?>
</div>